import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Button',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyStatelessWidget(),
    );
  }
}

class MyStatelessWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    //定义文本样式

    return Scaffold(
      appBar: AppBar(
        title: Text("Button"),
      ),
      //注意：超过盒子的方位会报错
      body:
      /*Row(
          //横向：start靠上对齐、end靠下对齐、center中线对齐(默认)
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
            Container(
              width: 200,
              height: 200,
              color: Colors.red,
            ),
            Container(
              width: 200,
              height: 400,
              color: Colors.blue,
            )
          ],
        )*/
      Column(
        //纵向：start靠上对齐、end靠下对齐、center中线对齐(默认)
        crossAxisAlignment: CrossAxisAlignment.end,
        children: <Widget>[
          Container(
            width: 200,
            height: 300,
            color: Colors.red,
          ),
          Container(
            width: 300,
            height: 200,
            color: Colors.blue,
          )
        ],
      )
    );
  }

}
